package loggeri.android.namespace;

import java.util.ArrayList;
import java.util.Date;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ScrollView;
import android.widget.LinearLayout;
import android.widget.Button;
import android.widget.TextView;
import android.widget.EditText;
import android.widget.CheckBox;


public class Chain {

	private static int stID = 0;
	private int id;
	private LinearLayout ll;
	private String name;
	private ArrayList<Node> nodes = new ArrayList<Node>(); 
	private Activity a;
	


	public Chain(String name, Activity a) {
		this.a = a;
		this.name = name;
		ll = new LinearLayout(a);
		ll.setOrientation(LinearLayout.VERTICAL);
		id = stID;
		stID++;
		
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public ArrayList<Node> getNodes() {
		return nodes;
	}
	public void setNodes(ArrayList<Node> nodes) {
		this.nodes = nodes;
	}
	
	public Node getLastNode(){
		
		return nodes.get(nodes.size()-1);
	}
	
	
	
	public int getId() {
		return id;
	}

	public void lisaaNode(Node node) {
		nodes.add(node);
	}

	
	public void tulostaNodet(Activity activity) {
		for(Node n : nodes) {
			//CheckBox cb = new CheckBox(activity);
			
		}
	}

	public LinearLayout getLl() {
		return ll;
	}

	public void setLl(LinearLayout ll) {
		this.ll = ll;
	}

	public static int getStID() {
		return stID;
	}

	public static void setStID(int stID) {
		Chain.stID = stID;
	}
	


}
